#ifndef __GDT_H__
#define __GDT_H__



typedef struct str_gdt_descriptor {
	unsigned short gdt_length;
	unsigned int gdt_addr;
} __attribute__((__packed__)) gdt_descriptor;


typedef struct str_gdt_entry {
	unsigned short limit_0_15;
	unsigned short base_0_15;
	unsigned char base_23_16;
	unsigned char type:4;
	unsigned char s:1;
	unsigned char dpl:2;
	unsigned char p:1;
	unsigned char limit_16_19:4;
	unsigned char avl:1;
	
	unsigned char l:1;
	unsigned char db:1;
	
	unsigned char g:1;
	unsigned char base_31_24;
} __attribute__((__packed__, aligned (8))) gdt_entry;

/** Tabla GDT **/
extern gdt_entry gdt[];
extern gdt_descriptor GDT_DESC;



#define GDT_COUNT 128
#define GDT_TASK_INI 6
#define TAREA1 7
#define ULTIMA_TAREA (6+TSS_COUNT-1)

extern const int ULTIMA_TAREA_ASM;
extern const int TAREA1_ASM;
extern const int TSS_COUNT_ASM;

#endif //__GDT_H__
